import java.util.Date;

import com.tracker.*;

import grails.converters.JSON

class BootStrap {

    def init = { servletContext ->	
	/*	println("------------------------------qwerty")
			new Company(title:"Mera", email:"main@mera.ru", startDate: new Date("1989/1/9"))
			.addToTur(new Tur(title:"first",dateCreate: new Date("1989/1/9"))
				.addToTimes(new Times(period:"1.05-15.05",dateCreate: new Date("1987/2/10"))
					.addToRequest(new Request(title_request:"Request2",company_name:"tur_house",count_persons:"2",name_tourist:"Petrov Sasha",phone_number:"4756512",addInform:"qweqwdsdcvdsvadfv",birthDate: new Date("1989/1/9")))))
			.addToTur(new Tur(title:"second",dateCreate: new Date("1989/1/9"))
				.addToTimes(new Times(period:"4.06-10.06",dateCreate: new Date("2015/9/16"))
					.addToRequest(new Request(title_request:"Request2",company_name:"tur_house",count_persons:"2",name_tourist:"Petrov Sasha",phone_number:"4756512",addInform:"qweqwdsdcvdsvadfv",birthDate: new Date("1989/1/9")))))
				.save()*/
    
		
		
	/*def company=new Company(title:"Company", email:"company@gmail.com", dateCreated: new Date("201/5/7")).save()
					
			def tur1=new Tur(title:"Turkey",description:"This is a good tur", dateCreated: new Date("1989/1/9"))
			company.addToTur(tur1)
			def tur2=new Tur(title:"Egypt",description:"This is a very good tur", dateCreated: new Date("1989/1/9"))
			company.addToTur(tur2)
			
			
			def hotel1=new Hotel(title:"Hotel Avrora",adress:"Tverskaya street",website:"www.avrora.ru",description:"description", dateCreated: new Date("1987/2/10"))
			tur1.addToHotel(hotel1)
			def hotel2=new Hotel(title:"Hotel Summer Time",adress:"Svoboda street",website:"www.summer.ru",description:"description", dateCreated: new Date("2011/5/15"))
			tur2.addToHotel(hotel2)
			
			//def tur1=new Tur(title:"third", dateCreate: new Date("1989/1/9")).save() 
			def times1=new Times(title:"1.05-15.05",price:"1254",dateCreated: new Date("1987/2/10"))
	        hotel1.addToTimes(times1)
			def times2=new Times(title:"4.06-10.06",price:"542", dateCreated: new Date("2015/9/16"))
			hotel2.addToTimes(times2)
			
			
			def request1=new Request(title:"Request",company_name:"turist",count_persons:"2",name_tourist:"Petrova Masha",phone_number:"4756512",description:"qweqwdsdcvdsvadfv",birthDate: new Date("1989/1/9"))
			times1.addToRequest(request1)
			def request2=new Request(title:"Request",company_name:"tur_house",count_persons:"2",name_tourist:"Petrov Sasha",phone_number:"4756512",description:"qweqwdsdcvdsvadfv",birthDate: new Date("1989/1/9"))
			times2.addToRequest(request2)	*/	
    }
    	
    def destroy = {
    }
}

